﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace WindowsForms
{
    public partial class MenuTypeProcess : DevExpress.XtraEditors.XtraForm
    {
        public MenuTypeProcess(bool? isModifyer = null)
        {
            InitializeComponent();
            if (isModifyer.HasValue)
            {
                GenerateModifyerControl(isModifyer.Value);
            }
        }

        private void GenerateModifyerControl(bool isModifyer)
        {
            if (isModifyer)
            {
                this.layoutControlGroup1.Text = "Chỉnh sửa thông tin loại món";
                this.layoutControlGroup1.CustomizationFormText = "Chỉnh sửa thông tin loại món";
                this.layoutControlGroup1.CaptionImage = global::WindowsForms.Properties.Resources.Edit;
            }
        }

        private void MenuTypeProcess_FormClosing(object sender, FormClosingEventArgs e)
        {
            e.Cancel = !dxValidationMenuType.Validate() && DialogResult == DialogResult.OK;
        }

        #region get, set
        public string MT_Name
        {
            get
            {
                return txtMenuTypeName.Text;
            }
            set
            {
                txtMenuTypeName.Text = value;
            }
        }
        public string MT_Des
        {
            get
            {
                return txtDes.Text;
            }
            set
            {
                txtDes.Text = value;
            }
        }
        #endregion

        private void MenuTypeProcess_Load(object sender, EventArgs e)
        {

        }
    }
}